package com.lvt.design.pattern.action.observer.p2pdemo;

/**
 * desc：假设我们在开发一个 P2P 投资理财系统，
 * 用户注册成功之后，我们会给用户发放投资体验金。
 *
 * @author LT
 * @date 2022/12/4
 */
public class UserController {
    private UserService userService;
    private PromotionService promotionService;

    public Long register(String telephone, String password) {
        // 省略参数校验等代码
        long userId = userService.register(telephone, password);
        promotionService.issueNewUserExperienceCase(userId);
        return userId;
    }
}
